﻿<?php
session_start();
if ($_session['user_guid'] == "" || $_session['user_guid'] == null)
{
//	header("Location:login.php");
}
require_once '../bin/DBA/DB.class.php';
require_once '../bin/DAL/ContactDAL.php';
require_once '../bin/BLL/ContactBLL.php';
//中文绑定
$chs_contact = ContactBLL::GetObjectByChs_Contact();
$chs_address = $chs_contact["address"];
$chs_name = $chs_contact["name"];
$chs_phone = $chs_contact["telephone"];
$chs_fax = $chs_contact["fax"];
$chs_mail = $chs_contact["email"];
$guid = $chs_contact["guid"];
//英文绑定
$eng_contact = ContactBLL::GetObjectByEng_Contact();
$eng_address = $eng_contact["address"];
$eng_name = $eng_contact["name"];
$eng_phone = $eng_contact["telephone"];
$eng_fax = $eng_contact["fax"];
$eng_mail = $eng_contact["email"];
//德文绑定
$deu_contact = ContactBLL::GetObjectByEng_Contact();
$deu_address = $eng_contact["address"];
$deu_name = $eng_contact["name"];
$deu_phone = $eng_contact["telephone"];
$deu_fax = $eng_contact["fax"];
$deu_mail = $eng_contact["email"];
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>无标题页</title>
    
    <link href="../Files/Css/products.css" rel="stylesheet" type="text/css" />
    <link href="../Files/Css/formpost.css" rel="stylesheet" charset="utf-8" type="text/css" />

    <script type="text/javascript" src="../Files/Javascript/jquery.js"></script>

    <script type="text/javascript">
    //<![CDATA[
    $(function(){
            //����Ǳ���ģ���Ӻ��Ǳ�ʶ.
            $("form :input.required").each(function(){
                var $required = $("<strong class='high'> *</strong>"); //����Ԫ��
                $(this).parent().append($required); //Ȼ����׷�ӵ��ĵ���
            });
             //�ı���ʧȥ�����
            $('form :input').blur(function(){
                 var $parent = $(this).parent();
                 $parent.find(".formtips").remove();
                 //����
                 //��֤��˾��ַ
                 if( $(this).is('#ipt_chs_address') ){
                        if( this.value=="" ){
                            var errorMsg = '请输入公司地址.';
                            $parent.append('<span class="formtips onError">'+errorMsg+'</span>');
                        }else{
                            var okMsg = '输入正确.';
                            $parent.append('<span class="formtips onSuccess">'+okMsg+'</span>');
                        }
                 }
                 //��֤��ϵ��
                 if( $(this).is('#ipt_chs_name') ){
                    if( this.value=="" ){
                          var errorMsg = '请输入联系人.';
                          $parent.append('<span class="formtips onError">'+errorMsg+'</span>');
                    }else{
                          var okMsg = '输入正确.';
                          $parent.append('<span class="formtips onSuccess">'+okMsg+'</span>');
                    }
                 }
                 //��֤��ϵ�绰
                 if( $(this).is('#ipt_chs_phone') ){
                    if( this.value=="" ){
                          var errorMsg = '请输入联系电话.';
                          $parent.append('<span class="formtips onError">'+errorMsg+'</span>');
                    }else{
                          var okMsg = '输入正确.';
                          $parent.append('<span class="formtips onSuccess">'+okMsg+'</span>');
                    }
                 }
                 //��֤�������
                 if( $(this).is('#ipt_chs_fax') ){
                    if( this.value=="" ){
                          var errorMsg = '请输入传真.';
                          $parent.append('<span class="formtips onError">'+errorMsg+'</span>');
                    }else{
                          var okMsg = '输入正确.';
                          $parent.append('<span class="formtips onSuccess">'+okMsg+'</span>');
                    }
                 }
                 //��֤�����ַ
                 if( $(this).is('#ipt_chs_mail') ){
                    if( this.value=="" || ( this.value!="" && !/.+@.+\.[a-zA-Z]{2,4}$/.test(this.value))){
                          var errorMsg = '请输入电子邮件地址.';
                          $parent.append('<span class="formtips onError">'+errorMsg+'</span>');
                    }else{
                          var okMsg = '输入正确.';
                          $parent.append('<span class="formtips onSuccess">'+okMsg+'</span>');
                    }
                 }
                 //Ӣ��
                 //��֤��˾��ַ
                 if( $(this).is('#ipt_eng_address') ){
                        if( this.value=="" ){
                            var errorMsg = '请输入公司地址.';
                            $parent.append('<span class="formtips onError">'+errorMsg+'</span>');
                        }else{
                            var okMsg = '输入正确.';
                            $parent.append('<span class="formtips onSuccess">'+okMsg+'</span>');
                        }
                 }
                 //��֤��ϵ��
                 if( $(this).is('#ipt_eng_name') ){
                    if( this.value=="" ){
                          var errorMsg = '请输入联系人.';
                          $parent.append('<span class="formtips onError">'+errorMsg+'</span>');
                    }else{
                          var okMsg = '输入正确.';
                          $parent.append('<span class="formtips onSuccess">'+okMsg+'</span>');
                    }
                 }
                 //��֤��ϵ�绰
                 if( $(this).is('#ipt_eng_phone') ){
                    if( this.value=="" ){
                          var errorMsg = '请输入联系电话.';
                          $parent.append('<span class="formtips onError">'+errorMsg+'</span>');
                    }else{
                          var okMsg = '输入正确.';
                          $parent.append('<span class="formtips onSuccess">'+okMsg+'</span>');
                    }
                 }
                 //��֤�������
                 if( $(this).is('#ipt_eng_fax') ){
                    if( this.value=="" ){
                          var errorMsg = '请输入传真.';
                          $parent.append('<span class="formtips onError">'+errorMsg+'</span>');
                    }else{
                          var okMsg = '输入正确.';
                          $parent.append('<span class="formtips onSuccess">'+okMsg+'</span>');
                    }
                 }
                 //��֤�����ַ
                 if( $(this).is('#ipt_eng_mail') ){
                    if( this.value=="" || ( this.value!="" && !/.+@.+\.[a-zA-Z]{2,4}$/.test(this.value))){
                          var errorMsg = '请输入电子邮件地址.';
                          $parent.append('<span class="formtips onError">'+errorMsg+'</span>');
                    }else{
                          var okMsg = '输入正确.';
                          $parent.append('<span class="formtips onSuccess">'+okMsg+'</span>');
                    }
                 }
                 //����
                 //��֤��˾��ַ
                 if( $(this).is('#ipt_deu_address') ){
                        if( this.value=="" ){
                            var errorMsg = '请输入公司地址.';
                            $parent.append('<span class="formtips onError">'+errorMsg+'</span>');
                        }else{
                            var okMsg = '输入正确.';
                            $parent.append('<span class="formtips onSuccess">'+okMsg+'</span>');
                        }
                 }
                 //��֤��ϵ��
                 if( $(this).is('#ipt_deu_name') ){
                    if( this.value=="" ){
                          var errorMsg = '请输入联系人.';
                          $parent.append('<span class="formtips onError">'+errorMsg+'</span>');
                    }else{
                          var okMsg = '输入正确.';
                          $parent.append('<span class="formtips onSuccess">'+okMsg+'</span>');
                    }
                 }
                 //��֤��ϵ�绰
                 if( $(this).is('#ipt_deu_phone') ){
                    if( this.value=="" ){
                          var errorMsg = '请输入联系电话.';
                          $parent.append('<span class="formtips onError">'+errorMsg+'</span>');
                    }else{
                          var okMsg = '输入正确.';
                          $parent.append('<span class="formtips onSuccess">'+okMsg+'</span>');
                    }
                 }
                 //��֤�������
                 if( $(this).is('#ipt_deu_fax') ){
                    if( this.value=="" ){
                          var errorMsg = '请输入传真.';
                          $parent.append('<span class="formtips onError">'+errorMsg+'</span>');
                    }else{
                          var okMsg = '输入正确.';
                          $parent.append('<span class="formtips onSuccess">'+okMsg+'</span>');
                    }
                 }
                 //��֤�����ַ
                 if( $(this).is('#ipt_deu_mail') ){
                    if( this.value=="" || ( this.value!="" && !/.+@.+\.[a-zA-Z]{2,4}$/.test(this.value))){
                          var errorMsg = '请输入电子邮件地址.';
                          $parent.append('<span class="formtips onError">'+errorMsg+'</span>');
                    }else{
                          var okMsg = '输入正确.';
                          $parent.append('<span class="formtips onSuccess">'+okMsg+'</span>');
                    }
                 }
            }).keyup(function(){
               $(this).triggerHandler("blur");
            }).focus(function(){
                 $(this).triggerHandler("blur");
            });//end blur

            
            //�ύ��������֤��
             $('#dosubmit').click(function(){
                    $("form :input.required").trigger('blur');
                    var numError = $('form .onError').length;
                    if(numError){
                        return false;
                    }
             });
    })
    //]]>
    </script>

</head>
<body>
    <form id="form1" method="post" action="ModContact.server.php">
    <div class="container">
        <div class="content">
        <div class="head">
                <div class="title">
                    <ul>
                        <li>增加/修改 联系方式</li>
                    </ul>
                </div>
                <div id="Div1">
                </div>
            </div>
            <table width="75%" cellpadding="0" cellspacing="0">
                <tr>
                    <td align="center" colspan="2">
                        中文
                    </td>
                </tr>
                <tr>
                    <td align="center" style="width: 30%">
                        地址
                    </td>
                    <td align="left">
                        <input id="ipt_chs_address" name="ipt_chs_address" type="text" class="required" size="50"
                            value="<?php echo $chs_address ?>" />
                    </td>
                </tr>
                <tr>
                    <td align="center" style="width: 30%">
                        联系人
                    </td>
                    <td align="left">
                        <input id="ipt_chs_name" name="ipt_chs_name" type="text" class="required" size="50"
                            value="<?php echo $chs_name ?>" />
                    </td>
                </tr>
                <tr>
                    <td align="center" style="width: 30%">
                        电话
                    </td>
                    <td align="left">
                        <input id="ipt_chs_phone" name="ipt_chs_phone" type="text" class="required" size="50"
                            value="<?php echo $chs_phone ?>" />
                    </td>
                </tr>
                <tr>
                    <td align="center" style="width: 30%">
                        传 真
                    </td>
                    <td align="left">
                        <input id="ipt_chs_fax" name="ipt_chs_fax" type="text" class="required" size="50"
                            value="<?php echo $chs_fax ?>" />
                    </td>
                </tr>
                <tr>
                    <td align="center" style="width: 30%">
                        Email
                    </td>
                    <td align="left">
                        <input id="ipt_chs_mail" name="ipt_chs_mail" type="text" class="required" size="50"
                            value="<?php echo $chs_mail ?>" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <hr />
                    </td>
                </tr>
                <tr>
                    <td align="center" colspan="2">
                        英文
                    </td>
                </tr>
                <tr>
                    <td align="center" style="width: 30%">
			地址
                    </td>
                    <td align="left">
                        <input id="ipt_eng_address" name="ipt_eng_address" type="text" class="required" size="50"
                            value="<?php echo $eng_address ?>" />
                    </td>
                </tr>
                <tr>
                    <td align="center" style="width: 30%">
                        联系人
                    </td>
                    <td align="left">
                        <input id="ipt_eng_name" name="ipt_eng_name" type="text" class="required" size="50"
                            value="<?php echo $eng_name ?>" />
                    </td>
                </tr>
                <tr>
                    <td align="center" style="width: 30%">
                        电话
                    </td>
                    <td align="left">
                        <input id="ipt_eng_phone" name="ipt_eng_phone" type="text" class="required" size="50"
                            value="<?php echo $eng_phone ?>" />
                    </td>
                </tr>
                <tr>
                    <td align="center" style="width: 30%">
                        传 真
                    </td>
                    <td align="left">
                        <input id="ipt_eng_fax" name="ipt_eng_fax" type="text" class="required" size="50"
                            value="<?php echo $eng_fax ?>" />
                    </td>
                </tr>
                <tr>
                    <td align="center" style="width: 30%">
                        Email
                    </td>
                    <td align="left">
                        <input id="ipt_eng_mail" name="ipt_eng_mail" type="text" class="required" size="50"
                            value="<?php echo $eng_mail ?>" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <hr />
                    </td>
                </tr>
                <tr>
                    <td align="center" colspan="2">
                        德文
                    </td>
                </tr>
                <tr>
                    <td align="center" style="width: 30%">
                        地址
                    </td>
                    <td align="left">
                        <input id="ipt_deu_address" name="ipt_deu_address" type="text" class="required" size="50"
                            value="<?php echo $deu_address ?>" />
                    </td>
                </tr>
                <tr>
                    <td align="center" style="width: 30%">
                        联系人
                    </td>
                    <td align="left">
                        <input id="ipt_deu_name" name="ipt_deu_name" type="text" class="required" size="50"
                            value="<?php echo $deu_name ?>" />
                    </td>
                </tr>
                <tr>
                    <td align="center" style="width: 30%">
                        电话
                    </td>
                    <td align="left">
                        <input id="ipt_deu_phone" name="ipt_deu_phone" type="text" class="required" size="50"
                            value="<?php echo $deu_phone ?>" />
                    </td>
                </tr>
                <tr>
                    <td align="center" style="width: 30%">
                        传 真
                    </td>
                    <td align="left">
                        <input id="ipt_deu_fax" name="ipt_deu_fax" type="text" class="required" size="50"
                            value="<?php echo $deu_fax ?>" />
                    </td>
                </tr>
                <tr>
                    <td align="center" style="width: 30%">
                        Email
                    </td>
                    <td align="left">
                        <input id="ipt_deu_mail" name="ipt_deu_mail" type="text" class="required" size="50"
                            value="<?php echo $deu_mail ?>" />
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <input id="ipt_guid" name="ipt_guid" type="hidden" value="<?php echo $guid?>" />
                        <hr />
                    </td>
                </tr>
                <tr>
                    <td align="center" colspan="2">
                        <input id="dosubmit" type="submit" value="提交数据" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
    </form>
</body>
</html>
